<?php
/**
 * Created by JetBrains PhpStorm.
 * User: thinhhung
 * Date: 5/24/12
 * Time: 3:07 PM
 * To change this template use File | Settings | File Templates.
 */
?>


<script>
    $(function () {
        $("#datepicker").datepicker(
            { dateFormat : 'dd-mm-yy' });
    });
</script>
<script type="text/javascript">
    $(document).ready(function(){
        $("#form").validate({
            messages: {
                "data[GiamGia][MUCGIAMGIA]": "Nhập mức giảm giá",
                "data[GiamGia][TGBD]": "Chọn thời gian bắt đầu"
            }
        });
    })
</script>

<?php
echo $this->Form->create('GiamGia', array('action' => 'add', 'id' => 'form'));
?>
<fieldset>
    <legend>Thêm chương trình giảm giá</legend>
    <?php echo $this->Form->input('id', array('readonly' => true)); ?>
    <dl>
        <dt><label>Đối tượng khách hàng</label></dt>
        <dd><?php echo $this->Form->input('DOITUONGKH_ID', array('type' => 'select', 'label' => false, 'options' => $doituongs)); ?></dd>
    </dl>
    <dl>
        <dt><label>Mức giảm giá</label></dt>
        <dd><?php echo $this->Form->input('MUCGIAMGIA', array('label' => false, 'class' => 'required')); ?></dd>
    </dl>
    <dl>
        <dt><label>Thời gian bắt đầu</label></dt>
        <dd><?php echo $this->Form->input('TGBD', array('id' => 'datepicker', 'type' => 'text','label' => false, 'class' => 'required')); ?></dd>
    </dl>
    <dl>

        <dd><?php echo $this->Form->input('TGKT', array('type' => 'hidden','label' => false, 'value' => '0000-00-00')); ?></dd>
    </dl>

</fieldset>
<div class="button">
<?php
echo $this->Form->submit('Thêm', array('div' => false, 'class' => 'add'));
echo $this->Html->link('Hủy', array('controller' => 'giamgias', 'action' => 'index'), array('class' => 'cancel'));?>

</div>